package com.vonchange.purchase.merchant.service.impl;

import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.vonchange.headb.core.map.HeaGetMap;
import com.vonchange.headb.core.map.HeaMap;
import com.vonchange.purchase.merchant.bean.Merchant;
import com.vonchange.purchase.merchant.dao.IMerchantDao;
import com.vonchange.purchase.merchant.service.IMerchantService;
import com.vonchange.utils.crud.dao.IBaseDao;
import com.vonchange.utils.crud.service.normal.impl.BaseServiceImpl;
@Service
@Transactional
public class MerchantServiceImpl extends BaseServiceImpl<Merchant> implements IMerchantService{
	@Resource
    private IMerchantDao merchantDao;
	@Override
	public IBaseDao<Merchant> getDao() {
		// TODO Auto-generated method stub
		return merchantDao;
	}
	public void initSave(Merchant entity) {
		entity.setCreateTime(new Date());
	}
	public void initUpdate(Merchant entity) {
		entity.setUpdateTime(new Date());
	}

	public void initFind(HeaMap parameter) {
		if(null==parameter.get("isDelete_eq")){
			parameter.set("isDelete_eq", 0);
		}
	}
}